package com.gomore.opple.module.incomeandexpense;

import com.gomore.opple.R;
import com.gomore.opple.module.BaseActivity;

import javax.inject.Inject;

/**
 * Created by asus on 2017/5/9.
 */
public class IncomeAndExpenseActivity extends BaseActivity {
    @Inject
    IncomeAndExpensePresenter incomeAndExpensePresenter;

    private IncomeAndExpenseFragment incomeAndExpenseFragment;

    @Override
    protected void initalizeViewData() {
        super.initalizeViewData();
    }

    @Override
    protected void initalizeViews() {
        if (incomeAndExpenseFragment == null) {
            incomeAndExpenseFragment = IncomeAndExpenseFragment.getInstance();
            replaceFragment(incomeAndExpenseFragment, false, "income_and_expense_view");
        }
    }

    @Override
    protected void initializeDependencyInjector() {
        DaggerIncomeAndExpenseComponent.builder()
                .dataRepositoryComponent(getRepositoryComponent())
                .incomeAndExpensePresenterModule((new IncomeAndExpensePresenterModule(incomeAndExpenseFragment)))
                .build()
                .inject(this);
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_income_and_expense;
    }

}
